home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / SWI / source / lib / qlfutil.pl < prev    next >
Encoding:
Text File  |  1995-08-16  |  1.0 KB  |  46 lines

  1. /*  $Id: qlfutil.pl,v 1.2 1995/08/16 11:49:44 jan Exp $
  2.  
  3.     Designed and implemented by Jan Wielemaker
  4.     E-mail: jan@swi.psy.uva.nl
  5.  
  6.     Copyright (C) 1995 University of Amsterdam. All rights reserved.
  7. */
  8.  
  9. :- module(qlfutil,
  10.       [ qlf_make_dir/1,
  11.         qlf_make/1
  12.       ]).
  13.  
  14. qlf_make_dir(Dir) :-
  15.     absolute_file_name('', Cwd),
  16.     chdir(Dir),
  17.     expand_file_name('*.qlf', QlfFiles),
  18.     forall(member(Qlf, QlfFiles),
  19.            qlf_make(Qlf)),
  20.     chdir(Cwd).
  21.  
  22. qlf_make(Base) :-
  23.     absolute_file_name(Base,
  24.                [ extensions(['.qlf']),
  25.                  access(read)
  26.                ],
  27.                QlfFile),
  28.     '$qlf_info'(QlfFile, V, V, Sources), !,
  29.     (   time_file(QlfFile, QlfStamp),
  30.         \+ ( member(Source, Sources),
  31.          time_file(Source, SourceStamp),
  32.          SourceStamp @> QlfStamp )
  33.     ->  true
  34.     ;   (   forall(member(Source, Sources),
  35.                access_file(Source, read))
  36.         ->    concat(PlBase, '.qlf', QlfFile),
  37.             user:qcompile(PlBase)
  38.         ;    '$warning'('Cannot update ~w: no access to sourcefile ~w',
  39.                [ QlfFile, Source ])
  40.         )
  41.     ).
  42. qlf_make(Base) :-
  43.     qcompile(Base).
  44.     
  45.     
  46.